// SensorTesterView.cpp : implementation of the CSensorTesterView class
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resourceppc.h"

#include "SensorTesterView.h"


BOOL CSensorTesterView::PreTranslateMessage(MSG* pMsg)
{
	return IsDialogMessage(pMsg);
}


LRESULT CSensorTesterView::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	gSensor = GSensorFactory::CreateGSensor();
	if(NULL == gSensor)
	{
		MessageBox(L"Can not Initialise GSensor.");
	}
	
	gSensor->Register();
	attachTo(gSensor);
	return TRUE;
}


void CSensorTesterView::IGSensor_GVectorChanged(IGSensor* gSensor, GVector gVector) 
{
	m_fltGvectorX = gVector.x;
	m_fltGvectorY = gVector.y;
	m_fltGvectorZ = gVector.z;
	DoDataExchange(DDX_LOAD);
}

CSensorTesterView::CSensorTesterView(void)
: m_fltGvectorX(0.0f)
, m_fltGvectorY(0.0f)
, m_fltGvectorZ(0.0f)
{
}
